The disclosure of this patent document contains material which is subject to copyright protection. The owner thereof has no objection to facsimile reproduction by anyone of the patent document or of the patent disclosure, as it appears in the United States Patent and Trademark Office patent file or records, but otherwise reserves all rights under copyright law.
The invention pertains to machine vision and, more particularly, to methods for image segmentation and object identification and defect detection.
In automated manufacturing, it is often important to determine the location, shape, size and/or angular orientation of an object being processed or assembled. For example, in automated wire bonding of integrated circuits, the precise location of leads in the xe2x80x9clead framexe2x80x9d and pads on the semiconductor die must be determined before wire bonds can be soldered them.
Although the human eye can readily distinguish between objects in an image, this is not historically the case for computerized machine vision systems. In the field of machine vision, the task of analyzing an image to isolate and identify its features is referred to as image segmentation. In an image of a lead frame, image segmentation can be employed to identify pixels in the image representing the leads, as well as those representing all other features,, i.e., xe2x80x9cbackground.xe2x80x9d By assigning values of xe2x80x9c1xe2x80x9d to the pixels representing leads, and by assigning values of xe2x80x9c0xe2x80x9d to the background pixels, image segmentation facilitates analysis of the image by other machine vision tools, such as xe2x80x9cconnectivityxe2x80x9d analysis.
The prior art suggests a number of techniques for segmenting an image. Thresholding, for example, involves identifying image intensities that distinguish an object (i.e., any feature of interest) from its background (i.e., any feature not of interest). For example, in an image of a lead frame, thresholding can be used to find an appropriate shade of gray that distinguishes each pixel in the image as object (i.e., lead) or background, thereby, completing segmentation. More complex thresholding techniques generate multiple threshold values that additionally permit the object to be identified.
Connectivity analysis is employed to isolate the features in a thresholded image. This technique segregates individual features by identifying their component pixels, particularly, those that are connected to each other by virtue of horizontal, vertical or diagonal adjacency.
Though the segmentation techniques described above are useful in isolating features of simple objects, they are often of only limited value in identifying objects with complex backgrounds. This typically arises in defect detection, that is, in segmenting images to identify defects on visually complicated surfaces, such as the surface of a semiconductor die, a printed circuit board, and printed materials. In these instances, segmentation is used to isolate a defect (if any) on these complex surfaces. If the surface has no defects, segmentation should reveal no object and only background. Otherwise, it should reveal the defect in the image as clusters of 1""s against a background 0""s.
To aid in segmenting complicated images, the prior art developed golden template comparison (GTC). This is a technique for locating defects by comparing a feature under scrutiny (to wit, a semiconductor die surface) to a good imagexe2x80x94or golden templatexe2x80x94that is stored in memory. The technique subtracts the good image from the test image and analyzes the difference to determine if the expected object (e.g., a defect) is present. For example, upon subtracting the image of a good pharmaceutical label from a defective one, the resulting xe2x80x9cdifferencexe2x80x9d image would reveal missing words and portions of characters.
Before GTC inspections can be performed, it must be xe2x80x9ctrainedxe2x80x9d so that the golden template can be stored in memory. To this end, the GTC training functions are employed to analyze several good samples of a scene to create a xe2x80x9cmeanxe2x80x9d image and xe2x80x9cstandard deviationxe2x80x9d image. The mean image is a statistical average of all the samples analyzed by the training functions. It defines what a typical good scene looks like. The standard deviation image defines those areas on the object where there is little variation from part to part, as well as those areas in which there is great variation from part to part. This latter image permits GTC""s runtime inspection functions to use less sensitivity in areas of greater expected variation, and more sensitivity in areas of less expected variation. In all cases, the edges present in the parts give rise a large standard deviation as a result of discrete pixel registration requirements, thus decreasing sensitivity in those regions.
At runtime, a system employing GTC captures an image of a scene of interest. Where the position of that scene is different from the training position, the captured image is aligned, or registered, with the mean image. The intensities of the captured image are also normalized with those of the mean image to ensure that variations illumination do not adversely affect the comparison.
The GTC inspection functions then subtract the registered, normalized, captured image from the mean image to produce a difference image that contains all the variations between the two. That difference image is then compared with a xe2x80x9cthresholdxe2x80x9d image derived from the standard deviation image. This determines which pixels of the difference image are to be ignored and which should be analyzed as possible defects. The latter are subjected to morphology, to eliminate or accentuate pixel data patterns and to eliminate noise. An object recognition technique, such as connectivity analysis, can then be employed to classify the apparent defects.
Although GTC inspection tools have proven quite successful, they suffer some limitations. For example, except in unusual circumstances, GTC requires registrationxe2x80x94i.e., that the image under inspection be registered with the template image. GTC also uses a standard deviation image for thresholding, which can result in a loss of resolution near edges due to high resulting threshold values. GTC is, additionally, limited to applications where the images are repeatable: it cannot be used where image-to-image variation results form changes in size, shape, orientation and warping.
An object of this invention, therefore, is to provide improved methods for machine vision and, more particularly, improved methods for image segmentation.
A further object is to provide such methods that can be used for defect identification.
Yet another object is to provide such methods that can be used in segmenting and inspecting repeatable, as well as non-repeatable, images.
Yet still another object is to provide such methods that do not routinely necessitate alignment or registration of an image under inspection with a template image.
Still yet a further object of the invention is to provide such methods that do not require training.
Still other objects of the invention include providing such machine vision methods as can be readily implemented on existing machine vision processing equipment, and which can be implemented for rapid execution without excessive consumption of computational power.
The foregoing objects are among those achieved by the invention which provides, in one aspect, a machine vision method for segmenting an image. The method includes the steps of generating a first image of at least the xe2x80x9cbackgroundxe2x80x9d or an object, generating a second image of the object and background, and subtracting the second image from the first image. The method is characterized in that the second image is generated such that subtraction of it from the first image emphasizes the object with respect to the background. As used here and throughout, unless otherwise evident from context, the term xe2x80x9cobjectxe2x80x9d refers to features of interest in an image (e.g., a defect), while the term xe2x80x9cbackgroundxe2x80x9d refers to features in an image that are not of interest (e.g., surface features on the semiconductor die on which the defect appears).
In related aspects of the invention, the second step is characterized as generating the second image such that its subtraction from the first image increases a contrast between the object and the background. That step is characterized, in still further aspects of the invention, as being one that results in object-to-background contrast differences in the second image that are of opposite polarity from the object-to-background contrast differences in the first image.
In further aspects, the invention calls for generating a third image with the results of the subtraction, and for isolating the object on that third image. Isolation can be performed, according to other aspects of the invention, by connectivity analysis, edge detection and/or tracking, and by thresholding. In the latter regard, a threshold imagexe2x80x94as opposed to one or two threshold valuesxe2x80x94can be generated by mapping image intensity values of the first or second image. That threshold image can, then, be subtracted from the third image (i.e, the difference image) to isolate further the object.
Still further objects of the invention provide for normalizing the first and second images before subtracting them to generate the third image. In this aspect, the invention determines distributions of intensity values of each of the first and second images, applying mapping functions to one or both of them in order to match the tails of those distributions. The first and second images can also be registered prior to subtraction.
According to further aspects of the invention, the first and second images are generated by illuminating the object and/or its background with different respective light or emission sources. This includes, for example, illuminating the object from the front in order to generate the first image, and illuminating it from behind in order to generate the second image. This includes, by way of further example, illuminating the object and its background with direct, on-axis lighting to generate the first image, and illuminating it with diffuse, off-access or grazing light to generate the second image. This includes, by way of still further example, illuminating the object with different wavelengths of light (e.g., red and blue) for each of the respective images, or in capturing reflections of different orientations (e.g., polarized and unpolarized) reflected from the object.
Additional aspects of the invention provide methods incorporating various combinations of the foregoing aspects.
These and other aspects of the invention are evident in the drawings and in the descriptions that follow.